﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Liang.UI
{
    public class DataGridViewRowHeaderCellEx:DataGridViewRowHeaderCell
    {
        public DataGridViewRowHeaderCellEx():base()
        {
            
        }

        protected override void Paint(
            System.Drawing.Graphics graphics, 
            System.Drawing.Rectangle clipBounds, 
            System.Drawing.Rectangle cellBounds, 
            int rowIndex, 
            DataGridViewElementStates cellState, 
            object value, 
            object formattedValue, 
            string errorText, 
            DataGridViewCellStyle cellStyle,
            DataGridViewAdvancedBorderStyle advancedBorderStyle,
            DataGridViewPaintParts paintParts)
        {
            base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts);
            //graphics.DrawString(rowIndex.ToString(), this.DataGridView.Font, new SolidBrush(Color.Blue), cellBounds);
            TextRenderer.DrawText(graphics, (rowIndex + 1).ToString(), DataGridView.Font, cellBounds, Color.Black);
        }
    }
}
